/**
 * @author yuyangyang
 * @time 2015/3/11
 */
var UserModel = require('../models/user');

module.exports = {
    addUser: function (params, callback) {
        new UserModel(params).save(function (err, data) {
            callback(err, data);
        });
    },
    queryUser: function (params, callback) {
        UserModel.findOne(params, function (err, data) {
            callback(err, data);
        });
    },
    queryById: function (params, callback) {
        UserModel.findById(params, function (err, data) {
            callback(err, data);
        });
    }
}